<template>
  <div>
    <h1>news</h1>
    <p>store: {{ getNum }}</p>
    <button @click="increment">+1</button>
    <button @click="decrement">-1</button>
  </div>
</template>

<script setup>
import { computed } from "vue";
import { useStore } from "vuex";

const $store = useStore();
const getNum = computed(() => $store.state.num);
const increment = () => {
  $store.dispatch("INCREASE", 5);
};
const decrement = () => {
  $store.dispatch("DECREADE", 5);
};
</script>

<style scoped></style>
